package com.office.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.office.system.mapper.FinanceAccountMapper;
import com.office.system.domain.FinanceAccount;
import com.office.system.service.IFinanceAccountService;

/**
 * 财务账户Service业务层处理
 * 
 * @author 数字牧马人
 */
@Service
public class FinanceAccountServiceImpl implements IFinanceAccountService 
{
    @Autowired
    private FinanceAccountMapper financeAccountMapper;

    /**
     * 查询财务账户
     * 
     * @param accountId 财务账户主键
     * @return 财务账户
     */
    @Override
    public FinanceAccount selectFinanceAccountByAccountId(Long accountId)
    {
        return financeAccountMapper.selectFinanceAccountByAccountId(accountId);
    }

    /**
     * 查询财务账户列表
     * 
     * @param financeAccount 财务账户
     * @return 财务账户
     */
    @Override
    public List<FinanceAccount> selectFinanceAccountList(FinanceAccount financeAccount)
    {
        return financeAccountMapper.selectFinanceAccountList(financeAccount);
    }

    /**
     * 新增财务账户
     * 
     * @param financeAccount 财务账户
     * @return 结果
     */
    @Override
    public int insertFinanceAccount(FinanceAccount financeAccount)
    {
        return financeAccountMapper.insertFinanceAccount(financeAccount);
    }

    /**
     * 修改财务账户
     * 
     * @param financeAccount 财务账户
     * @return 结果
     */
    @Override
    public int updateFinanceAccount(FinanceAccount financeAccount)
    {
        return financeAccountMapper.updateFinanceAccount(financeAccount);
    }

    /**
     * 批量删除财务账户
     * 
     * @param accountIds 需要删除的财务账户主键
     * @return 结果
     */
    @Override
    public int deleteFinanceAccountByAccountIds(Long[] accountIds)
    {
        return financeAccountMapper.deleteFinanceAccountByAccountIds(accountIds);
    }

    /**
     * 删除财务账户信息
     * 
     * @param accountId 财务账户主键
     * @return 结果
     */
    @Override
    public int deleteFinanceAccountByAccountId(Long accountId)
    {
        return financeAccountMapper.deleteFinanceAccountByAccountId(accountId);
    }

    /**
     * 更新账户余额
     * 
     * @param accountId 账户ID
     * @param amount 金额变化
     * @return 结果
     */
    @Override
    public int updateAccountBalance(Long accountId, java.math.BigDecimal amount)
    {
        return financeAccountMapper.updateAccountBalance(accountId, amount);
    }
} 